<DOCTYPE html>
<html>
<head>
    <title>聚惠家</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <?php foreach ($this->config->item('style_css_paths') as $css): ?>
      <link rel="stylesheet" href=<?php echo $css ?> />
    <?php endforeach ?>
    <?php foreach ($this->config->item('style_js_paths') as $js): ?>
      <script type="text/javascript" src=<?php echo $js?> ></script>
    <?php endforeach ?>
    <script type="text/javascript" src=<?php echo base_url("/scripts/logic/uihelper.js") ;?>></script>
</head>
 
<body>
    <?php
        $bill_info = $query[0];
        $name = $bill_info['name'];
        $phone = $bill_info['phone'];
        $address = $bill_info['address'];
        $dorm = $bill_info['dorm'];
        $note = $bill_info['note'];
        $json = json_decode($bill_info['bill_json'],TRUE);
        $list = $json['list'];
        $print_state = $bill_info['print_state'];
        $send_email = $bill_info['send_email'];
    ?>
    <div data-role="page" id="payhistory" > 
        <div data-role="header" data-theme="b">
            <h1>账单记录</h1>
        </div> 

        <div role="main" class="ui-content">
 
            <div class="ui-corner-all custom-corners">
              <div class="ui-bar ui-bar-a">
                <h3>账单<?php echo '(总价' . $json['total_price'] . '元)';?></h3>
              </div>
              <div class="ui-body ui-body-a">

                 <table data-role="table" id="movie-table" data-mode="" class="">
                  <thead>
                    <tr>
                      <th data-priority="persist">名称</th>
                      <th data-priority="2">价格</th>
                      <th data-priority="3">数量</th>
                    </tr>
                  </thead>
                    <?php        
                        echo '<tbody>';
                        foreach ($list as $item):
                            if ($item['item_account'] > 0 )
                            {
                                echo '<tr><td>' . $item['item_name'] . '</td>'
                                        . '<td>' . $item['item_price'] . '</td>'
                                        . '<td>' . $item['item_account'] . '</td>'
                                    .'</tr>';
                            }
                        endforeach;
                        echo '</tbody>';
                    ?>
                </table>

              </div>
            </div>

            <form method="post" action="demoform.asp">
              <div data-role="fieldcontain">
                <label for="fname">姓名:</label>
                <input readonly type="text" name="fname" id="fname" value = "<?php echo $name;?>" >
                <label for="lname">联系方式:</label>
                <input readonly type="text" name="lname" id="lname" value = "<?php echo $phone;?>" >
                <label for="address">送货地址:</label>
                <input readonly type="text" name="address" id="address" value = "<?php echo $address;?>" >
                <label for="address">寝室楼号:</label>
                <?php 
                    if ($dorm == null or $dorm == 0)
                        $dorm = "未填写";
                      else
                        $dorm = "宿舍 " . $dorm . " 号楼";
                ?>
                <input readonly type="text" name="address" id="address" value = "<?php echo $dorm;?>" >
                <label for="note">备注:</label>
                <input readonly type="text" name="note" id="note" value = "<?php echo $note;?>" >
                <label for="print_state">状态:</label>
                <input readonly type="text" name="print_state" id="print_state" value = "<?php
                if ($print_state == 1 or $send_email == 1)
                  echo '店铺已确认！';
                else 
                  echo '订单处理中！';
                ?>" >
              </div>
              
            </form>
            <a href="#history" class="ui-btn ui-btn-b" data-rel="back">确定</a>

        </div>   
    </div>
</body> 
</html>

